package com.skywolf.chem.tencent.utils;

import com.skywolf.chem.utils.SysConfig;

/**
 * Created by zh on 2018/7/25.
 */
public class TencentImgUtils {
    public static String domain = SysConfig._this.getProperty("tencent_cdn.domain");//"https://mechat-im-1257114180.piccd.myqcloud.com/21535688665088M03AWSLG";
    //剪切
    public static String style1_400_400 = "imageMogr2/crop/400x400";
    //等比压缩--以宽来压缩
    public static String style2_400_400="imageView2/2/w/400";

    public static String getImgUrl(String imgId,Integer widthImg){
        String urlImg = "";
        if(widthImg==null){
            urlImg = imgId+"?"+style2_400_400;
        }else{
            urlImg = imgId+"?"+"imageView2/2/w/"+widthImg;
        }
        return urlImg;
    }

    public static String getImgUrl(String imgId){
        return imgId+"?"+style2_400_400;
    }

    /**
     * 获取小程序图标地址
     * @param imgId
     * @return
     */
    public static String getMiniImg(String imgId){
        return imgId+"?imageView2/2/w/80/h/80";
    }
}
